home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / pcl / src-16f.lha / compiler / fndb.lisp < prev    next >
Encoding:
Text File  |  1992-05-22  |  40.9 KB  |  1,159 lines

  1. ;;; -*- Package: C; Log: C.Log -*-
  2. ;;;
  3. ;;; **********************************************************************
  4. ;;; This code was written as part of the CMU Common Lisp project at
  5. ;;; Carnegie Mellon University, and has been placed in the public domain.
  6. ;;; If you want to use this code or any part of CMU Common Lisp, please contact
  7. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
  8. ;;;
  9. (ext:file-comment
  10.   "$Header: fndb.lisp,v 1.43.1.1 92/05/22 00:51:57 ram Exp $")
  11. ;;;
  12. ;;; **********************************************************************
  13. ;;;
  14. ;;;    This file defines all the standard functions to be known functions.
  15. ;;; Each function has type and side-effect information, and may also have IR1
  16. ;;; optimizers.
  17. ;;;
  18. ;;; Written by Rob MacLachlan
  19. ;;;
  20. (in-package "C")
  21.  
  22. (in-package "LISP")
  23. (import '(
  24.       %aset
  25.       %bitset
  26.       %charset
  27.       %primitive
  28.       %put
  29.       %puthash
  30.       %rplaca
  31.       %rplacd
  32.       %sbitset
  33.       %scharset
  34.       %set-documentation
  35.       %set-fdefinition
  36.       %set-fill-pointer
  37.       %set-row-major-aref
  38.       %setelt
  39.       %setnth
  40.       %standard-char-p
  41.       %svset
  42.       %typep
  43.       array-header-p
  44.       base-char-p
  45.       double-float-p
  46.       long-float-p
  47.       short-float-p
  48.       single-float-p
  49.       string<*
  50.       string>*
  51.       string<=*
  52.       string>=*
  53.       string=*
  54.       string/=*
  55.       %sp-string-compare
  56.       )
  57.     "C")
  58.  
  59. (in-package "KERNEL")
  60.  
  61. (export '(%caller-frame-and-pc %with-array-data))
  62.  
  63. (in-package 'c)
  64.  
  65.  
  66. ;;;; Information for known functions:
  67.  
  68. (defknown coerce (t type-specifier) t
  69.       (movable foldable)              ; Is defined to signal errors. 
  70.   :derive-type (result-type-specifier-nth-arg 2))
  71.  
  72. (defknown type-of (t) t (foldable flushable))
  73.  
  74. ;;; Can be affected by type definitions...
  75. (defknown (upgraded-complex-part-type upgraded-array-element-type)
  76.       (type-specifier) type-specifier
  77.   (flushable))
  78.  
  79.  
  80. ;;;; In the "Predicates" chapter:
  81.  
  82. (defknown typep (t type-specifier) boolean (foldable flushable))
  83. (defknown subtypep (type-specifier type-specifier) (values boolean boolean)
  84.       (foldable flushable))
  85.  
  86. (defknown (null symbolp atom consp listp numberp integerp rationalp floatp
  87.         complexp characterp stringp bit-vector-p vectorp
  88.         simple-vector-p simple-string-p simple-bit-vector-p arrayp
  89.         packagep functionp compiled-function-p not)
  90.   (t) boolean (movable foldable flushable))
  91.  
  92.  
  93. (defknown (eq eql) (t t) boolean (movable foldable flushable))
  94. (defknown (equal equalp) (t t) boolean (foldable flushable recursive))
  95.  
  96.  
  97. ;;;; In the "Control Structure" chapter:
  98.  
  99. ;;; Not flushable, since required to signal an error if unbound.
  100. (defknown (symbol-value symbol-function) (symbol) t ())
  101.  
  102. (defknown boundp (symbol) boolean (flushable))
  103. (defknown fboundp ((or symbol cons)) boolean (flushable explicit-check))
  104. (defknown special-form-p (symbol) t (movable foldable flushable)) ; They never change...
  105. (defknown set (symbol t) t (unsafe)
  106.   :derive-type #'result-type-last-arg)
  107. (defknown fdefinition ((or symbol cons)) function (unsafe explicit-check))
  108. (defknown %set-fdefinition ((or symbol cons) function) function
  109.   (unsafe explicit-check))
  110. (defknown makunbound (symbol) symbol)
  111. (defknown fmakunbound ((or symbol cons)) (or symbol cons)
  112.   (unsafe explicit-check))
  113. (defknown (get-setf-method get-setf-method-multiple-value)
  114.   ((or list symbol) &optional lexical-environment)
  115.   (values list list list form form)
  116.   (flushable))
  117. (defknown apply (callable t &rest t) *) ; ### Last arg must be List...
  118. (defknown funcall (callable &rest t) *)
  119.  
  120. (defknown (mapcar maplist mapcan mapcon) (callable list &rest list) list
  121.   (call))
  122.  
  123. (defknown (mapc mapl) (callable list &rest list) list (foldable call))
  124.  
  125. ;;; We let values-list be foldable, since constant-folding will turn it into
  126. ;;; VALUES.  VALUES is not foldable, since MV constants are represented by a
  127. ;;; call to VALUES.
  128. ;;; 
  129. (defknown values (&rest t) * (movable flushable unsafe))
  130. (defknown values-list (list) * (movable foldable flushable))
  131.  
  132.  
  133. ;;;; In the "Macros" chapter:
  134.  
  135. (defknown macro-function (symbol &optional lexical-environment)
  136.   (or function null)
  137.   (flushable))
  138. (defknown (macroexpand macroexpand-1) (t &optional lexical-environment)
  139.   (values form &optional boolean))
  140.  
  141. (defknown compiler-macro-function (t &optional lexical-environment)
  142.   (or function null)
  143.   (flushable))
  144. (defknown (compiler-macroexpand compiler-macroexpand-1)
  145.       (t &optional lexical-environment)
  146.   (values form &optional boolean))
  147.  
  148.  
  149. ;;;; In the "Declarations" chapter:
  150.  
  151. (defknown proclaim (list) void)
  152.  
  153.  
  154. ;;;; In the "Symbols" chapter:
  155.  
  156. (defknown get (symbol t &optional t) t (flushable))
  157. (defknown remprop (symbol t) t)
  158. (defknown symbol-plist (symbol) list (flushable))
  159. (defknown getf (list t &optional t) t (foldable flushable))
  160. (defknown get-properties (list list) (values t t list) (foldable flushable))
  161. (defknown symbol-name (symbol) simple-string (movable foldable flushable))
  162. (defknown make-symbol (string) symbol (flushable))
  163. (defknown copy-symbol (symbol &optional t) symbol (flushable))
  164. (defknown gensym (&optional (or string unsigned-byte)) symbol ())
  165. (defknown symbol-package (symbol) (or package null) (flushable))
  166. (defknown keywordp (t) boolean (flushable))      ; If someone uninterns it...
  167.  
  168.  
  169. ;;;; In the "Packages" chapter:
  170.  
  171.  
  172. (deftype packagelike () '(or stringlike package))
  173. (deftype symbols () '(or list symbol))
  174.  
  175. ;;; Should allow a package name, I think, tho CLtL II doesn't say so...
  176. (defknown gentemp (&optional string packagelike) symbol)
  177.  
  178. (defknown make-package (stringlike &key (use list) (nicknames list)
  179.                    ;; ### Extensions...
  180.                    (internal-symbols index) (external-symbols index))
  181.       package)
  182. (defknown in-package (stringlike &key (nicknames list) (use list)) package)
  183. (defknown find-package (stringlike) (or package null) (flushable))
  184. (defknown package-name (packagelike) simple-string (flushable))
  185. (defknown package-nicknames (packagelike) list (flushable))
  186. (defknown rename-package (packagelike stringlike &optional list) package)
  187. (defknown package-use-list (packagelike) list (flushable))
  188. (defknown package-used-by-list (packagelike) list (flushable))
  189. (defknown package-shadowing-symbols (packagelike) list (flushable))
  190. (defknown list-all-packages () list (flushable))
  191. (defknown intern (string &optional packagelike)
  192.   (values symbol (member :internal :external :inherited nil))
  193.   ())
  194. (defknown find-symbol (string &optional packagelike)
  195.       (values symbol (member :internal :external :inherited nil))
  196.       (flushable))
  197. (defknown (export import) (symbols &optional packagelike) truth)
  198. (defknown unintern (symbol &optional packagelike) boolean)
  199. (defknown unexport (symbols &optional packagelike) truth)
  200. (defknown shadowing-import (symbols &optional packagelike) truth)
  201. (defknown shadow ((or symbol string list) &optional packagelike) truth)
  202. (defknown (use-package unuse-package) ((or list packagelike) &optional packagelike) truth)
  203. (defknown find-all-symbols (stringlike) list (flushable))
  204.  
  205.  
  206. ;;;; In the "Numbers" chapter:
  207.  
  208. (defknown zerop (number) boolean (movable foldable flushable explicit-check))
  209. (defknown (plusp minusp) (real) boolean
  210.   (movable foldable flushable explicit-check))
  211. (defknown (oddp evenp) (integer) boolean
  212.   (movable foldable flushable explicit-check))
  213. (defknown (= /=) (number &rest number) boolean
  214.   (movable foldable flushable explicit-check))
  215. (defknown (< > <= >=) (real &rest real) boolean
  216.   (movable foldable flushable explicit-check))
  217. (defknown (max min) (real &rest real) real
  218.   (movable foldable flushable explicit-check))
  219.  
  220. (defknown + (&rest number) number
  221.   (movable foldable flushable explicit-check))
  222. (defknown - (number &rest number) number
  223.   (movable foldable flushable explicit-check))
  224. (defknown * (&rest number) number
  225.   (movable foldable flushable explicit-check))
  226. (defknown / (number &rest number) number
  227.   (movable foldable flushable explicit-check))
  228. (defknown (1+ 1-) (number) number
  229.   (movable foldable flushable explicit-check))
  230.  
  231. (defknown conjugate (number) number
  232.   (movable foldable flushable explicit-check))
  233.  
  234. (defknown gcd (&rest integer) unsigned-byte
  235.   (movable foldable flushable explicit-check)
  236.   #|:derive-type 'boolean-result-type|#)
  237. (defknown lcm (&rest integer) unsigned-byte
  238.   (movable foldable flushable explicit-check))
  239.  
  240. (defknown exp (number) irrational
  241.   (movable foldable flushable explicit-check recursive)
  242.   :derive-type #'result-type-float-contagion)
  243.  
  244. (defknown expt (number number) number
  245.   (movable foldable flushable explicit-check recursive))
  246. (defknown log (number &optional real) irrational
  247.   (movable foldable flushable explicit-check))
  248. (defknown sqrt (number) irrational
  249.   (movable foldable flushable explicit-check))
  250. (defknown isqrt (unsigned-byte) unsigned-byte
  251.   (movable foldable flushable explicit-check))
  252.  
  253. (defknown (abs phase signum) (number) number
  254.   (movable foldable flushable explicit-check))
  255. (defknown cis (real) (complex float)
  256.   (movable foldable flushable explicit-check))
  257.  
  258. (defknown (sin cos) (number)
  259.   (or (float -1.0 1.0) (complex (float -1.0 1.0)))
  260.   (movable foldable flushable explicit-check recursive)
  261.   :derive-type #'result-type-float-contagion)
  262.  
  263. (defknown atan
  264.   (number &optional real) irrational
  265.   (movable foldable flushable explicit-check recursive)
  266.   :derive-type #'result-type-float-contagion)
  267.  
  268. (defknown (tan sinh cosh tanh asinh)
  269.   (number) irrational (movable foldable flushable explicit-check recursive)
  270.   :derive-type #'result-type-float-contagion)
  271.  
  272. (defknown (asin acos acosh atanh)
  273.   (number) irrational
  274.   (movable foldable flushable explicit-check recursive))
  275.  
  276. (defknown float (real &optional float) float
  277.   (movable foldable flushable explicit-check))
  278.  
  279. (defknown (rational rationalize) (real) rational
  280.   (movable foldable flushable explicit-check))
  281.  
  282. (defknown (numerator denominator) (rational) integer
  283.   (movable foldable flushable))
  284.  
  285. (defknown (floor ceiling truncate round)
  286.   (real &optional real) (values integer real)
  287.   (movable foldable flushable explicit-check))
  288.  
  289. (defknown (mod rem) (real real) real
  290.   (movable foldable flushable explicit-check))
  291.  
  292. (defknown (ffloor fceiling fround ftruncate)
  293.   (real &optional real) (values float float)
  294.   (movable foldable flushable explicit-check))
  295.  
  296. (defknown decode-float (float) (values float float-exponent float)
  297.   (movable foldable flushable explicit-check))
  298. (defknown scale-float (float float-exponent) float
  299.   (movable foldable flushable explicit-check))
  300. (defknown float-radix (float) float-radix
  301.   (movable foldable flushable explicit-check))
  302. (defknown float-sign (float &optional float) float
  303.   (movable foldable flushable explicit-check))
  304. (defknown (float-digits float-precision) (float) float-digits
  305.   (movable foldable flushable explicit-check))
  306. (defknown integer-decode-float (float)
  307.       (values integer float-exponent (member -1 1))
  308.       (movable foldable flushable explicit-check))
  309.  
  310. (defknown complex (real &optional real) number
  311.   (movable foldable flushable explicit-check))
  312.  
  313. (defknown (realpart imagpart) (number) real (movable foldable flushable))
  314.  
  315. (defknown (logior logxor logand logeqv) (&rest integer) integer
  316.   (movable foldable flushable explicit-check))
  317.  
  318. (defknown (lognand lognor logandc1 logandc2 logorc1 logorc2)
  319.       (integer integer) integer
  320.   (movable foldable flushable explicit-check))
  321.  
  322. (defknown boole (boole-code integer integer) integer
  323.   (movable foldable flushable))
  324.  
  325. (defknown lognot (integer) integer (movable foldable flushable explicit-check))
  326. (defknown logtest (integer integer) boolean (movable foldable flushable))
  327. (defknown logbitp (bit-index integer) boolean (movable foldable flushable))
  328. (defknown ash (integer ash-index) integer (movable foldable flushable explicit-check))
  329. (defknown (logcount integer-length) (integer) bit-index
  330.   (movable foldable flushable explicit-check))
  331. (defknown byte (bit-index bit-index) byte-specifier
  332.   (movable foldable flushable))
  333. (defknown (byte-size byte-position) (byte-specifier) bit-index
  334.   (movable foldable flushable)) 
  335. (defknown ldb (byte-specifier integer) integer (movable foldable flushable))
  336. (defknown ldb-test (byte-specifier integer) boolean
  337.   (movable foldable flushable))
  338. (defknown mask-field (byte-specifier integer) integer
  339.   (movable foldable flushable))
  340. (defknown dpb (integer byte-specifier integer) integer
  341.   (movable foldable flushable))
  342. (defknown deposit-field (integer byte-specifier integer) integer
  343.   (movable foldable flushable))
  344. (defknown random (real &optional random-state) real ())
  345. (defknown make-random-state (&optional (or (member nil t) random-state))
  346.   random-state (flushable))
  347. (defknown random-state-p (t) boolean (movable foldable flushable))
  348.  
  349. ;;; In "Characters" chapter:
  350. (defknown (standard-char-p graphic-char-p alpha-char-p
  351.                upper-case-p lower-case-p both-case-p alphanumericp)
  352.   (character) boolean (movable foldable flushable))
  353.  
  354. (defknown digit-char-p (character &optional unsigned-byte)
  355.   (or (integer 0 35) null) (movable foldable flushable))
  356.  
  357. (defknown (char= char/= char< char> char<= char>= char-equal char-not-equal
  358.          char-lessp char-greaterp char-not-greaterp char-not-lessp)
  359.   (character &rest character) boolean (movable foldable flushable))
  360.  
  361. (defknown character (t) character (movable foldable flushable))
  362. (defknown char-code (character) char-code (movable foldable flushable))
  363. (defknown code-char (char-code) base-char (movable foldable flushable))
  364. (defknown (char-upcase char-downcase) (character) character
  365.   (movable foldable flushable))
  366. (defknown digit-char (integer &optional integer)
  367.   (or character null) (movable foldable flushable))
  368. (defknown char-int (character) char-code (movable foldable flushable))
  369. (defknown char-name (character) (or simple-string null)
  370.   (movable foldable flushable))
  371. (defknown name-char (stringable) (or character null)
  372.   (movable foldable flushable))
  373.  
  374.  
  375. ;;;; In the "Sequences" chapter:
  376.  
  377. (defknown elt (sequence index) t (foldable flushable))
  378.  
  379. (defknown subseq (sequence index &optional sequence-end) consed-sequence
  380.   (foldable flushable)
  381.   :derive-type (sequence-result-nth-arg 1))
  382.  
  383. (defknown copy-seq (sequence) consed-sequence (foldable flushable)
  384.   :derive-type #'result-type-first-arg)
  385.  
  386.  
  387. (defknown length (sequence) index (foldable flushable))
  388.  
  389. (defknown reverse (sequence) consed-sequence (foldable flushable)
  390.   :derive-type #'result-type-first-arg)
  391.  
  392. (defknown nreverse (sequence) sequence ()
  393.   :derive-type #'result-type-first-arg)
  394.  
  395. (defknown make-sequence (type-specifier index &key (initial-element t)) consed-sequence
  396.   (movable flushable unsafe)
  397.   :derive-type (result-type-specifier-nth-arg 1))
  398.  
  399. (defknown concatenate (type-specifier &rest sequence) consed-sequence
  400.   (foldable flushable)
  401.   :derive-type (result-type-specifier-nth-arg 1))
  402.  
  403. (defknown map (type-specifier callable sequence &rest sequence) consed-sequence
  404.   (flushable call)
  405. ;  :derive-type 'type-spec-arg1  Nope... (map nil ...) returns null, not nil.
  406.   )
  407.  
  408. ;;; Returns predicate result... 
  409. (defknown some (callable sequence &rest sequence) t
  410.   (foldable flushable call))
  411.  
  412. (defknown (every notany notevery) (callable sequence &rest sequence) boolean
  413.   (foldable flushable call))
  414.  
  415. ;;; Unsafe for :Initial-Value...
  416. (defknown reduce (callable sequence &key (from-end t) (start index)
  417.                (end sequence-end) (initial-value t) (key callable))
  418.   t
  419.   (foldable flushable call unsafe))
  420.  
  421. (defknown fill (sequence t &key (start index) (end sequence-end)) sequence
  422.   (unsafe)
  423.   :derive-type #'result-type-first-arg)
  424.  
  425. (defknown replace (sequence sequence &key (start1 index) (end1 sequence-end)
  426.                 (start2 index) (end2 sequence-end))
  427.   consed-sequence ()
  428.   :derive-type #'result-type-first-arg)
  429.  
  430. (defknown remove
  431.   (t sequence &key (from-end t) (test callable)
  432.      (test-not callable) (start index) (end sequence-end)
  433.      (count sequence-end) (key callable))
  434.   consed-sequence
  435.   (flushable call)
  436.   :derive-type (sequence-result-nth-arg 2))
  437.  
  438. (defknown substitute
  439.   (t t sequence &key (from-end t) (test callable)
  440.      (test-not callable) (start index) (end sequence-end)
  441.      (count sequence-end) (key callable))
  442.   consed-sequence
  443.   (flushable call)
  444.   :derive-type (sequence-result-nth-arg 3))
  445.  
  446. (defknown (remove-if remove-if-not)
  447.   (callable sequence &key (from-end t) (start index) (end sequence-end)
  448.         (count sequence-end) (key callable))
  449.   consed-sequence
  450.   (flushable call)
  451.   :derive-type (sequence-result-nth-arg 2))
  452.  
  453. (defknown (substitute-if substitute-if-not)
  454.   (t callable sequence &key (from-end t) (start index) (end sequence-end)
  455.      (count sequence-end) (key callable))
  456.   consed-sequence
  457.   (flushable call)
  458.   :derive-type (sequence-result-nth-arg 3))
  459.  
  460. (defknown delete
  461.   (t sequence &key (from-end t) (test callable)
  462.      (test-not callable) (start index) (end sequence-end)
  463.      (count sequence-end) (key callable))
  464.   sequence
  465.   (flushable call)
  466.   :derive-type (sequence-result-nth-arg 2))
  467.  
  468. (defknown nsubstitute
  469.   (t t sequence &key (from-end t) (test callable)
  470.      (test-not callable) (start index) (end sequence-end)
  471.      (count sequence-end) (key callable))
  472.   sequence
  473.   (flushable call)
  474.   :derive-type (sequence-result-nth-arg 3))
  475.  
  476. (defknown (delete-if delete-if-not)
  477.   (callable sequence &key (from-end t) (start index) (end sequence-end)
  478.         (count sequence-end) (key callable))
  479.   sequence
  480.   (flushable call)
  481.   :derive-type (sequence-result-nth-arg 2))
  482.  
  483. (defknown (nsubstitute-if nsubstitute-if-not)
  484.   (t callable sequence &key (from-end t) (start index) (end sequence-end)
  485.      (count sequence-end) (key callable))
  486.   sequence
  487.   (flushable call)
  488.   :derive-type (sequence-result-nth-arg 3))
  489.  
  490. (defknown remove-duplicates
  491.   (sequence &key (test callable) (test-not callable) (start index) (from-end t)
  492.         (end sequence-end) (key callable))
  493.   consed-sequence
  494.   (flushable call)
  495.   :derive-type (sequence-result-nth-arg 1))
  496.  
  497. (defknown delete-duplicates
  498.   (sequence &key (test callable) (test-not callable) (start index) (from-end t)
  499.         (end sequence-end) (key callable))
  500.   sequence
  501.   (flushable call)
  502.   :derive-type (sequence-result-nth-arg 1))
  503.  
  504. (defknown find (t sequence &key (test callable) (test-not callable)
  505.           (start index) (from-end t) (end sequence-end) (key callable))
  506.   t
  507.   (foldable flushable call))
  508.  
  509. (defknown (find-if find-if-not)
  510.   (callable sequence &key (from-end t) (start index) (end sequence-end)
  511.         (key callable))
  512.   t
  513.   (foldable flushable call))
  514.  
  515. (defknown position (t sequence &key (test callable) (test-not callable)
  516.               (start index) (from-end t) (end sequence-end)
  517.               (key callable))
  518.   (or index null)
  519.   (foldable flushable call))
  520.  
  521. (defknown (position-if position-if-not)
  522.   (callable sequence &key (from-end t) (start index) (end sequence-end)
  523.         (key callable))
  524.   (or index null)
  525.   (foldable flushable call))
  526.  
  527. (defknown count (t sequence &key (test callable) (test-not callable)
  528.               (start index) (from-end t) (end sequence-end)
  529.               (key callable))
  530.   index
  531.   (foldable flushable call))
  532.  
  533. (defknown (count-if count-if-not)
  534.   (callable sequence &key (from-end t) (start index) (end sequence-end)
  535.         (key callable))
  536.   index
  537.   (foldable flushable call))
  538.  
  539. (defknown (mismatch search)
  540.   (sequence sequence &key (from-end t) (test callable) (test-not callable)
  541.         (start1 index) (end1 sequence-end) (start2 index) (end2 sequence-end)
  542.         (key callable))
  543.   (or index null)
  544.   (foldable flushable call))
  545.  
  546. ;;; Not flushable, since vector sort guaranteed in-place...
  547. (defknown (stable-sort sort) (sequence callable &key (key callable)) sequence
  548.   (call)
  549.   :derive-type (sequence-result-nth-arg 1))
  550.  
  551. (defknown merge (type-specifier sequence sequence callable
  552.                 &key (key callable))
  553.   sequence
  554.   (flushable call)
  555.   :derive-type (result-type-specifier-nth-arg 1))
  556.  
  557.  
  558. ;;;; In the "Manipulating List Structure" chapter:
  559.  
  560. (defknown (car cdr caar cadr cdar cddr caaar caadr cadar caddr cdaar cdadr
  561.            cddar cdddr caaaar caaadr caadar caaddr cadaar cadadr caddar
  562.            cadddr cdaaar cdaadr cdadar cdaddr cddaar cddadr cdddar cddddr
  563.            first second third fourth fifth sixth seventh eighth ninth tenth
  564.            rest)
  565.   (list) t (foldable flushable))
  566.  
  567. (defknown cons (t t) cons (movable flushable unsafe))
  568.  
  569. (defknown tree-equal (t t &key (test callable) (test-not callable)) boolean
  570.   (foldable flushable call))
  571. (defknown endp (t) boolean (foldable flushable movable))
  572. (defknown list-length (list) (or index null) (foldable flushable))
  573. (defknown (nth nthcdr) (index list) t (foldable flushable))
  574. (defknown last (list &optional index) list (foldable flushable))
  575. (defknown list (&rest t) list (movable flushable unsafe))
  576. (defknown list* (t &rest t) t (movable flushable unsafe))
  577. (defknown make-list (index &key (initial-element t)) list
  578.   (movable flushable unsafe))
  579.  
  580. ;;;
  581. ;;; All but last must be list...
  582. (defknown append (&rest t) t (flushable))
  583.  
  584. (defknown copy-list (list) list (flushable))
  585. (defknown copy-alist (list) list (flushable))
  586. (defknown copy-tree (t) t (flushable))
  587. (defknown revappend (list t) t (flushable))
  588. (defknown nconc (&rest list) list ())
  589. (defknown nreconc (list list) list ())
  590. (defknown butlast (list &optional index) list (flushable))
  591. (defknown nbutlast (list &optional index) list ())
  592. (defknown ldiff (list list) list (flushable))
  593. (defknown (rplaca rplacd) (cons t) list (unsafe))
  594.  
  595. (defknown (nsubst subst) (t t t &key (key callable) (test callable)
  596.                 (test-not callable))
  597.   list (flushable unsafe call))
  598.  
  599. (defknown (subst-if subst-if-not nsubst-if nsubst-if-not)
  600.       (t t t &key (key callable))
  601.   list (flushable unsafe call))
  602.  
  603. (defknown (sublis nsublis) (list t &key (key callable) (test callable)
  604.                  (test-not callable))
  605.   list (flushable unsafe call))
  606.  
  607. (defknown member (t list &key (key callable) (test callable)
  608.             (test-not callable))
  609.   list (foldable flushable call))
  610. (defknown (member-if member-if-not) (callable list &key (key callable))
  611.   list (foldable flushable call))
  612.  
  613. (defknown tailp (list list) boolean (foldable flushable))
  614.  
  615. (defknown adjoin (t list &key (key callable) (test callable)
  616.             (test-not callable))
  617.   list (foldable flushable unsafe call))
  618.  
  619. (defknown (union intersection set-difference set-exclusive-or)
  620.       (list list &key (key callable) (test callable) (test-not callable))
  621.   list
  622.   (foldable flushable call))
  623.  
  624. (defknown (nunion nintersection nset-difference nset-exclusive-or)
  625.       (list list &key (key callable) (test callable) (test-not callable))
  626.   list
  627.   (foldable flushable call))
  628.  
  629. (defknown subsetp 
  630.       (list list &key (key callable) (test callable) (test-not callable))
  631.   boolean
  632.   (foldable flushable call))
  633.  
  634. (defknown acons (t t t) list (movable flushable unsafe))
  635. (defknown pairlis (t t &optional t) list (flushable unsafe))
  636.  
  637. (defknown (rassoc assoc)
  638.       (t list &key (key callable) (test callable) (test-not callable))
  639.   list (foldable flushable call))
  640. (defknown (assoc-if-not assoc-if rassoc-if rassoc-if-not)
  641.       (callable list &key (:key callable)) list (foldable flushable call))
  642.  
  643.  
  644. ;;;; In the "Hash Tables" chapter:
  645.  
  646. (defknown make-hash-table
  647.   (&key (test callable) (size index) (rehash-size (or (integer (0)) (float (1.0))))
  648.     (rehash-threshold (or (integer (0)) (float (0.0) (1.0)))))
  649.   hash-table
  650.   (flushable unsafe))
  651. (defknown hash-table-p (t) boolean (movable foldable flushable))
  652. (defknown gethash (t hash-table &optional t) (values t boolean)
  653.   (foldable flushable unsafe))
  654. (defknown %puthash (t hash-table t) t (unsafe))
  655. (defknown remhash (t hash-table) boolean ())
  656. (defknown maphash (callable hash-table) null (foldable flushable call))
  657. (defknown clrhash (hash-table) hash-table ())
  658. (defknown hash-table-count (hash-table) fixnum (foldable flushable))
  659.  
  660. (deftype non-negative-fixnum () `(integer 0 ,most-positive-fixnum))
  661. (defknown sxhash (t) non-negative-fixnum (foldable flushable))
  662.  
  663.  
  664. ;;;; In the "Arrays" chapter:
  665.  
  666. (defknown make-array ((or index list) &key (element-type type-specifier)
  667.               (initial-element t) (initial-contents t)
  668.               (adjustable t) (fill-pointer t)
  669.               (displaced-to (or array null))
  670.               (displaced-index-offset index))
  671.   array (flushable unsafe))
  672.  
  673. (defknown vector (&rest t) simple-vector (flushable unsafe))
  674.  
  675. (defknown aref (array &rest index) t (foldable flushable))
  676. (defknown row-major-aref (array index) t (foldable flushable))
  677.  
  678. (defknown array-element-type (array) type-specifier (foldable flushable))
  679. (defknown array-rank (array) array-rank (foldable flushable))
  680. (defknown array-dimension (array array-rank) index (foldable flushable))
  681. (defknown array-dimensions (array) list (foldable flushable))
  682. (defknown array-in-bounds-p (array &rest index) boolean (foldable flushable))
  683. (defknown array-row-major-index (array &rest index) array-total-size
  684.   (foldable flushable)) 
  685. (defknown array-total-size (array) array-total-size (foldable flushable))
  686. (defknown adjustable-array-p (array) boolean (movable foldable flushable))
  687.  
  688. (defknown svref (simple-vector index) t (foldable flushable))
  689. (defknown bit ((array bit) &rest index) bit (foldable flushable))
  690. (defknown sbit ((simple-array bit) &rest index) bit (foldable flushable))
  691.  
  692. (defknown (bit-and bit-ior bit-xor bit-eqv bit-nand bit-nor bit-andc1 bit-andc2
  693.            bit-orc1 bit-orc2)
  694.   ((array bit) (array bit) &optional (or (array bit) (member t)))
  695.   (array bit)
  696.   (foldable)
  697.   #|:derive-type #'result-type-last-arg|#)
  698.  
  699. (defknown bit-not ((array bit) &optional (or (array bit) (member t)))
  700.   (array bit)
  701.   (foldable)
  702.   #|:derive-type #'result-type-last-arg|#)
  703.  
  704. (defknown array-has-fill-pointer-p (array) boolean (movable foldable flushable))
  705. (defknown fill-pointer (vector) index (foldable flushable))
  706. (defknown vector-push (t vector) (or index null) ())
  707. (defknown vector-push-extend (t vector &optional index) index ())
  708. (defknown vector-pop (vector) t ())
  709.  
  710. (defknown adjust-array
  711.   (array (or index list) &key (element-type type-specifier)
  712.      (initial-element t) (initial-contents list)
  713.      (fill-pointer t) (displaced-to (or array null))
  714.      (displaced-index-offset index))
  715.   array (unsafe))
  716. ;  :derive-type 'result-type-arg1) Not even close...
  717.  
  718.  
  719. ;;;; In the "Strings" chapter:
  720.  
  721. (defknown char (string index) character (foldable flushable))
  722. (defknown schar (simple-string index) character (foldable flushable))
  723.  
  724. (deftype stringable () '(or character string symbol))
  725.  
  726. (defknown (string= string-equal)
  727.   (stringable stringable &key (start1 index) (end1 sequence-end)
  728.           (start2 index) (end2 sequence-end))
  729.   boolean
  730.   (foldable flushable))
  731.  
  732. (defknown (string< string> string<= string>= string/= string-lessp
  733.            string-greaterp string-not-lessp string-not-greaterp
  734.            string-not-equal)
  735.   (stringable stringable &key (start1 index) (end1 sequence-end)
  736.           (start2 index) (end2 sequence-end))
  737.   (or index null)
  738.   (foldable flushable))
  739.  
  740. (defknown make-string (index &key (initial-element character))
  741.   simple-string (flushable))
  742.  
  743. (defknown (string-trim string-left-trim string-right-trim)
  744.   (sequence stringable) simple-string (flushable))
  745.  
  746. (defknown (string-upcase string-downcase string-capitalize)
  747.   (stringable &key (start index) (end sequence-end))
  748.   simple-string (flushable))
  749.  
  750. (defknown (nstring-upcase nstring-downcase nstring-capitalize)
  751.   (string &key (start index) (end sequence-end))
  752.   string ())
  753.  
  754. (defknown string (stringable) string
  755.   (flushable explicit-check))
  756.  
  757.  
  758. ;;; Internal non-keyword versions of string predicates:
  759.  
  760. (defknown (string<* string>* string<=* string>=* string/=*)
  761.   (stringable stringable index sequence-end index sequence-end)
  762.   (or index null)
  763.   (foldable flushable))
  764.  
  765. (defknown string=*
  766.   (stringable stringable index sequence-end index sequence-end)
  767.   boolean
  768.   (foldable flushable))
  769.  
  770.  
  771. ;;;; In the "Eval" chapter:
  772.  
  773. (defknown eval (t) *)
  774. (defknown constantp (t) boolean (foldable flushable))
  775.  
  776.  
  777. ;;;; In the "Streams" chapter:
  778.  
  779. (defknown make-synonym-stream (symbol) stream (flushable))
  780. (defknown make-broadcast-stream (&rest stream) stream (flushable))
  781. (defknown make-concatenated-stream (&rest stream) stream (flushable))
  782. (defknown make-two-way-stream (stream stream) stream (flushable))
  783. (defknown make-echo-stream (stream stream) stream (flushable))
  784. (defknown make-string-input-stream (string &optional index index) stream (flushable unsafe))
  785. (defknown make-string-output-stream () stream (flushable))
  786. (defknown get-output-stream-string (stream) simple-string ())
  787. (defknown streamp (t) boolean (movable foldable flushable))
  788. (defknown stream-element-type (stream) type-specifier (movable foldable flushable))
  789. (defknown (output-stream-p input-stream-p) (stream) boolean (movable foldable
  790.                                      flushable))
  791. (defknown close (stream &key (abort t)) stream ())
  792.  
  793.  
  794. ;;;; In the "Input/Output" chapter:
  795.  
  796. ;;; The I/O functions are currently given effects ANY under the theory that
  797. ;;; code motion over I/O operations is particularly confusing and not very
  798. ;;; important for efficency.
  799.  
  800. (defknown copy-readtable (&optional (or readtable null) readtable) readtable
  801.   ())
  802. (defknown readtablep (t) boolean (movable foldable flushable))
  803.  
  804. (defknown set-syntax-from-char
  805.   (character character &optional (or readtable null) readtable) void
  806.   ())
  807.  
  808. (defknown set-macro-character (character callable &optional t readtable) void
  809.   (unsafe))
  810. (defknown get-macro-character (character &optional readtable)
  811.   (values callable boolean) (flushable))
  812.  
  813. (defknown make-dispatch-macro-character (character &optional t readtable)
  814.   void ())
  815. (defknown set-dispatch-macro-character
  816.   (character character callable &optional readtable) void
  817.   (unsafe))
  818. (defknown get-dispatch-macro-character
  819.   (character character &optional readtable) callable
  820.   (flushable))
  821.  
  822. ;;; May return any type due to eof-value...
  823. (defknown (read read-preserving-whitespace read-char-no-hang read-char)
  824.   (&optional streamlike t t t) t  (explicit-check))
  825.  
  826. (defknown read-delimited-list (character &optional streamlike t) t
  827.   (explicit-check))
  828. (defknown read-line (&optional streamlike t t t) (values t boolean)
  829.   (explicit-check))
  830. (defknown unread-char (character &optional streamlike) t
  831.   (explicit-check))
  832. (defknown peek-char (&optional (or character (member nil t)) streamlike t t t)
  833.   t
  834.   (explicit-check))
  835. (defknown listen (&optional streamlike) boolean (flushable explicit-check))
  836.  
  837. (defknown clear-input (&optional stream) null (explicit-check))
  838.  
  839. (defknown read-from-string
  840.   (string &optional t t &key (start index) (end sequence-end)
  841.       (preserve-whitespace t))
  842.   t)
  843. (defknown parse-integer
  844.   (string &key (start index) (end sequence-end) (radix (integer 2 36))
  845.       (junk-allowed t)) 
  846.   (or integer null ()))
  847.  
  848. (defknown read-byte (stream &optional t t) t (explicit-check))
  849.  
  850. (defknown write
  851.   (t &key (stream streamlike) (escape t) (radix t) (base (integer 2 36))
  852.      (circle t) (pretty t) (level (or unsigned-byte null)) (readably t)
  853.      (length (or unsigned-byte null)) (case t) (array t) (gensym t)
  854.      (lines (or unsigned-byte null)) (right-margin (or unsigned-byte null))
  855.      (miser-width (or unsigned-byte null)) (pprint-dispatch t))
  856.   t
  857.   (any explicit-check)
  858.   :derive-type #'result-type-first-arg)
  859.  
  860. (defknown (prin1 print princ) (t &optional streamlike) t (any explicit-check)
  861.   :derive-type #'result-type-first-arg)
  862.  
  863. ;;; xxx-TO-STRING not foldable because they depend on the dynamic environment. 
  864. (defknown write-to-string
  865.   (t &key (escape t) (radix t) (base (integer 2 36)) (readably t)
  866.      (circle t) (pretty t) (level (or unsigned-byte null))
  867.      (length (or unsigned-byte null)) (case t) (array t) (gensym t)
  868.      (lines (or unsigned-byte null)) (right-margin (or unsigned-byte null))
  869.      (miser-width (or unsigned-byte null)) (pprint-dispatch t))
  870.   simple-string
  871.   (foldable flushable explicit-check))
  872.  
  873. (defknown (prin1-to-string princ-to-string) (t) simple-string (flushable))
  874.  
  875. (defknown write-char (character &optional streamlike) character
  876.   (explicit-check))
  877. (defknown (write-string write-line)
  878.   (string &optional streamlike &key (start index) (end sequence-end))
  879.   string
  880.   (explicit-check))
  881.  
  882. (defknown (terpri finish-output force-output clear-output)
  883.   (&optional streamlike) null
  884.   (explicit-check))
  885.  
  886. (defknown fresh-line (&optional streamlike) boolean
  887.   (explicit-check))
  888.  
  889. (defknown write-byte (integer stream) integer
  890.   (explicit-check))
  891.  
  892. (defknown format ((or streamlike string) (or string function) &rest t)
  893.   (or string null)
  894.   (explicit-check))
  895.  
  896. (defknown (y-or-n-p yes-or-no-p) (&optional string &rest t) boolean
  897.   (explicit-check))
  898.  
  899.  
  900. ;;;; In the "File System Interface" chapter:
  901.  
  902. (defknown wild-pathname-p (pathnamelike &optional (member nil :host :device
  903.                               :directory :name
  904.                               :type :version))
  905.   boolean
  906.   (foldable flushable))
  907. (defknown pathname-match-p (pathnamelike pathnamelike) boolean
  908.   (foldable flushable))
  909. (defknown translate-pathname (pathnamelike pathnamelike pathnamelike &key)
  910.   pathname
  911.   (foldable flushable))
  912.  
  913. ;;; Need to add the logical pathname stuff here.
  914.  
  915. (defknown pathname (pathnamelike) pathname (foldable flushable))
  916. (defknown truename (pathnamelike) pathname ())
  917.  
  918. (defknown parse-namestring
  919.   (pathnamelike &optional pathname-host pathnamelike
  920.         &key (start index) (end sequence-end) (junk-allowed t))
  921.   (values (or pathname null) index)
  922.   ())
  923.  
  924. (defknown merge-pathnames
  925.   (pathnamelike &optional pathnamelike pathname-version)
  926.   pathname
  927.   (foldable flushable))
  928.  
  929. (defknown make-pathname
  930.  (&key (defaults pathnamelike) (host pathname-host) (device pathname-device)
  931.        (directory (or pathname-directory string (member :wild)))
  932.        (name (or pathname-name string (member :wild)))
  933.        (type (or pathname-type string (member :wild)))
  934.        (version pathname-version) (case (member :local :common)))
  935.   pathname (foldable flushable))
  936.  
  937. (defknown pathnamep (t) boolean (movable foldable flushable))
  938.  
  939. (defknown pathname-host (pathnamelike &key (case (member :local :common)))
  940.   pathname-host (foldable flushable))
  941. (defknown pathname-device (pathnamelike &key (case (member :local :common)))
  942.   pathname-device (foldable flushable))
  943. (defknown pathname-directory (pathnamelike &key (case (member :local :common)))
  944.   pathname-directory (foldable flushable))
  945. (defknown pathname-name (pathnamelike &key (case (member :local :common)))
  946.   pathname-name (foldable flushable))
  947. (defknown pathname-type (pathnamelike &key (case (member :local :common)))
  948.   pathname-type (foldable flushable))
  949. (defknown pathname-version (pathnamelike)
  950.   pathname-version (foldable flushable))
  951.  
  952. (defknown (namestring file-namestring directory-namestring host-namestring)
  953.   (pathnamelike) simple-string
  954.   (foldable flushable))
  955.  
  956. (defknown enough-namestring (pathnamelike &optional pathnamelike)
  957.   simple-string
  958.   (foldable flushable))
  959.  
  960. (defknown user-homedir-pathname (&optional t) pathname (flushable))
  961.  
  962. (defknown open
  963.   (pathnamelike &key (direction (member :input :output :io :probe))
  964.         (element-type type-specifier)
  965.         (if-exists (member :error :new-version :rename
  966.                    :rename-and-delete :overwrite :append
  967.                    :supersede nil))
  968.         (if-does-not-exist (member :error :create nil)))
  969.   (or stream null))
  970.  
  971. (defknown rename-file (pathnamelike filename) (values pathname pathname pathname))
  972. (defknown delete-file (pathnamelike) t)
  973. (defknown probe-file (pathnamelike) (or pathname null) (flushable))
  974. (defknown file-write-date (pathnamelike) (or unsigned-byte null) (flushable))
  975. (defknown file-author (pathnamelike) (or simple-string null) (flushable))
  976.  
  977. (defknown file-position (stream &optional
  978.                 (or unsigned-byte (member :start :end)))
  979.   (or unsigned-byte (member t nil)))
  980. (defknown file-length (stream) (or unsigned-byte null) (flushable))
  981.  
  982. (defknown load
  983.   ((or filename stream)
  984.    &key (verbose t) (print t) (if-does-not-exist (member :error :create nil))
  985.    (if-source-newer (member :load-source :load-object :query :compile))
  986.    (contents (or null (member :source :binary))))
  987.   t)
  988.  
  989. (defknown directory (pathnamelike &key (check-for-subdirs t) (all t)
  990.                   (follow-links t))
  991.   list (flushable))
  992.  
  993.  
  994. ;;;; In the "Errors" chapter:
  995.  
  996. (defknown error (t &rest t) nil) ; Never returns...
  997. (defknown cerror (string t &rest t) null)
  998. (defknown warn (t &rest t) null)
  999. (defknown break (&optional t &rest t) null)
  1000.  
  1001.  
  1002. ;;;; In the "Miscellaneous" Chapter.
  1003.  
  1004. ;;; ### Compiler interface non-standard...
  1005. (defknown compile (symbol &optional (or list function null))
  1006.   (values (or function symbol) boolean boolean))
  1007.  
  1008. (deftype optional-filename () '(or filename (member t nil)))
  1009.  
  1010. (defknown compile-file
  1011.   ((or optional-filename list) &key (output-file optional-filename) (error-file optional-filename)
  1012.    (trace-file optional-filename) (error-output t) (load t) (verbose t)
  1013.    (print t) (progress t) (block-compile t) (entry-points list))
  1014.   (values (or pathname null) boolean boolean))
  1015. (defknown disassemble (callable &optional stream) void)
  1016.  
  1017. (defknown documentation ((or symbol cons) symbol)
  1018.   (or string null)
  1019.   (flushable))
  1020.  
  1021. (defknown describe (t &optional stream) (values))
  1022. (defknown inspect (t) (values))
  1023.  
  1024. (defknown room (&optional (member t nil :default)) void)
  1025. (defknown ed (&optional (or symbol cons filename) &key (:init t) (:display t))
  1026.   t)
  1027. (defknown dribble (&optional filename &key (if-exists t)) t)
  1028.  
  1029. (defknown apropos (stringlike &optional packagelike t) (values))
  1030. (defknown apropos-list (stringlike &optional packagelike t) list (flushable))
  1031.  
  1032. (defknown get-decoded-time ()
  1033.   (values (integer 0 59) (integer 0 59) (integer 0 23) (integer 1 31)
  1034.       (integer 1 12) unsigned-byte (integer 0 6) boolean (rational 0 (24)))
  1035.   (flushable))
  1036.  
  1037. (defknown get-universal-time () unsigned-byte (flushable))
  1038.  
  1039. (defknown decode-universal-time (unsigned-byte &optional (integer 0 23))
  1040.   (values (integer 0 59) (integer 0 59) (integer 0 23) (integer 1 31)
  1041.       (integer 1 12) unsigned-byte (integer 0 6) boolean (rational 0 (24)))
  1042.   (flushable))
  1043.  
  1044. (defknown encode-universal-time
  1045.   ((integer 0 59) (integer 0 59) (integer 0 23) (integer 1 31)
  1046.    (integer 1 12) unsigned-byte &optional (rational 0 (24)))
  1047.   unsigned-byte
  1048.   (flushable))
  1049.  
  1050. (defknown (get-internal-run-time get-internal-real-time)
  1051.   () internal-time (flushable))
  1052.  
  1053. (defknown sleep ((or (rational 0) (float 0.0))) null)
  1054.  
  1055. (defknown (lisp-implementation-type
  1056.        lisp-implementation-version machine-type machine-version
  1057.        machine-instance software-type software-version short-site-name
  1058.        long-site-name)
  1059.   () simple-string (flushable))
  1060.  
  1061. (defknown identity (t) t (movable foldable flushable unsafe)
  1062.   :derive-type #'result-type-first-arg)
  1063.  
  1064. (defknown constantly (t &rest t) function (movable flushable))
  1065. (defknown complement (function) function (movable flushable))
  1066.  
  1067.  
  1068. ;;;; Magical compiler frobs:
  1069.  
  1070. ;;; Can't fold in general because of SATISFIES.  There is a special optimizer
  1071. ;;; anyway.
  1072. (defknown %typep (t (or type-specifier ctype)) boolean
  1073.   (movable flushable explicit-check))
  1074.  
  1075. (defknown %cleanup-point () void)
  1076. (defknown %special-bind (t t) void)
  1077. (defknown %special-unbind (t) void)
  1078. (defknown %listify-rest-args (t t) list (flushable))
  1079. (defknown %more-arg-context (t t) (values t fixnum) (flushable))
  1080. (defknown %more-arg (t t) t)
  1081. (defknown %verify-argument-count (t t) nil)
  1082. (defknown %argument-count-error (t) nil)
  1083. (defknown %unknown-values () *)
  1084. (defknown %catch (t t) void)
  1085. (defknown %unwind-protect (t t) void)
  1086. (defknown (%catch-breakup %unwind-protect-breakup) () void)
  1087. (defknown %lexical-exit-breakup (t) void)
  1088. (defknown %continue-unwind (t t t) nil)
  1089. (defknown %throw (t &rest t) nil); This is MV-called.
  1090. (defknown %nlx-entry (t) *)
  1091. (defknown %%primitive (t t &rest t) *)
  1092. (defknown %pop-values (t) void)
  1093. (defknown %type-check-error (t t) nil)
  1094. (defknown %odd-keyword-arguments-error () nil)
  1095. (defknown %unknown-keyword-argument-error (t) nil)
  1096. (defknown (%ldb %mask-field) (bit-index bit-index integer) unsigned-byte
  1097.   (movable foldable flushable explicit-check))
  1098. (defknown (%dpb %deposit-field) (integer bit-index bit-index integer) integer
  1099.   (movable foldable flushable explicit-check))
  1100. (defknown %negate (number) number (movable foldable flushable explicit-check))
  1101. (defknown %check-bound (array index fixnum) index (movable foldable flushable))
  1102. (defknown data-vector-ref (array index) t (foldable flushable explicit-check))
  1103. (defknown data-vector-set (array index t) t (unsafe explicit-check))
  1104. (defknown kernel:%caller-frame-and-pc () (values t t) (flushable))
  1105. (defknown kernel:%with-array-data (array index (or index null))
  1106.   (values (simple-array * (*)) index index index)
  1107.   (foldable flushable))
  1108. (defknown %set-symbol-function (symbol function) function (unsafe))
  1109. (defknown %set-symbol-package (symbol t) t (unsafe))
  1110.  
  1111. ;;; Structure slot accessors or setters are magically "known" to be these
  1112. ;;; functions, although the var remains the Slot-Accessor describing the actual
  1113. ;;; function called.
  1114. ;;;
  1115. (defknown %slot-accessor (t) t (foldable flushable))
  1116. (defknown %slot-setter (t t) t (unsafe))
  1117.  
  1118.  
  1119. ;;;; Setf inverses:
  1120.  
  1121. (defknown %aset (array &rest t) t (unsafe))
  1122. (defknown %set-row-major-aref (array index t) t (unsafe))
  1123. (defknown %rplaca (cons t) t (unsafe))
  1124. (defknown %rplacd (cons t) t (unsafe))
  1125. (defknown %put (symbol t t) t (unsafe))
  1126. (defknown %setelt (sequence index t) t (unsafe))
  1127. (defknown %svset (simple-vector index t) t (unsafe))
  1128. (defknown %bitset (bit-vector &rest index) bit (unsafe))
  1129. (defknown %sbitset (simple-bit-vector &rest index) bit (unsafe))
  1130. (defknown %charset (string index character) character (unsafe))
  1131. (defknown %scharset (simple-string index character) character (unsafe))
  1132. (defknown %set-symbol-value (symbol t) t (unsafe))
  1133. (defknown fset (symbol function) function (unsafe))
  1134. (defknown %set-symbol-plist (symbol t) t (unsafe))
  1135. (defknown %set-documentation ((or symbol cons) symbol (or string null))
  1136.   (or string null)
  1137.   ())
  1138. (defknown %setnth (index list t) t (unsafe))
  1139. (defknown %set-fill-pointer (vector index) (unsafe))
  1140.  
  1141.  
  1142. ;;;; Internal type predicates:
  1143. ;;;
  1144. ;;;    Simple typep uses that don't have any standard predicate are translated
  1145. ;;; into non-standard unary predicates.
  1146.  
  1147. (defknown (fixnump bignump ratiop short-float-p single-float-p double-float-p
  1148.        long-float-p base-char-p %standard-char-p structurep
  1149.        array-header-p)
  1150.   (t) boolean (movable foldable flushable))
  1151.  
  1152.  
  1153. ;;;; Miscellaneous "sub-primitives":
  1154.  
  1155. (defknown %sp-string-compare
  1156.   (simple-string index index simple-string index index)
  1157.   (or index null)
  1158.   (foldable flushable))
  1159.